home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 3921 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.4 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 65 | 77 73 2e 63 61 6e 64 75 |Path: ne|ws.candu|
|00000010| 2e 61 65 63 6c 2e 63 61 | 21 6e 65 77 73 0a 46 72 |.aecl.ca|!news.Fr|
|00000020| 6f 6d 3a 20 4d 61 72 6b | 20 4b 6f 74 79 6b 20 3c |om: Mark| Kotyk <|
|00000030| 6b 6f 74 79 6b 6d 40 73 | 61 73 6b 2e 61 65 63 6c |kotykm@s|ask.aecl|
|00000040| 2e 63 61 3e 0a 4e 65 77 | 73 67 72 6f 75 70 73 3a |.ca>.New|sgroups:|
|00000050| 20 63 6f 6d 70 2e 6c 61 | 6e 67 2e 63 0a 53 75 62 | comp.la|ng.c.Sub|
|00000060| 6a 65 63 74 3a 20 52 65 | 3a 20 50 72 69 6e 74 69 |ject: Re|: Printi|
|00000070| 6e 67 20 74 6f 20 4c 50 | 54 31 20 50 72 69 6e 74 |ng to LP|T1 Print|
|00000080| 65 72 20 66 72 6f 6d 20 | 77 69 74 68 69 6e 20 70 |er from |within p|
|00000090| 72 6f 67 72 61 6d 0a 44 | 61 74 65 3a 20 57 65 64 |rogram.D|ate: Wed|
|000000a0| 2c 20 33 31 20 4a 61 6e | 20 31 39 39 36 20 31 34 |, 31 Jan| 1996 14|
|000000b0| 3a 32 35 3a 31 34 20 2d | 30 36 30 30 0a 4f 72 67 |:25:14 -|0600.Org|
|000000c0| 61 6e 69 7a 61 74 69 6f | 6e 3a 20 41 45 43 4c 0a |anizatio|n: AECL.|
|000000d0| 4d 65 73 73 61 67 65 2d | 49 44 3a 20 3c 33 31 30 |Message-|ID: <310|
|000000e0| 46 44 30 32 41 2e 36 38 | 34 38 40 73 61 73 6b 2e |FD02A.68|48@sask.|
|000000f0| 61 65 63 6c 2e 63 61 3e | 0a 52 65 66 65 72 65 6e |aecl.ca>|.Referen|
|00000100| 63 65 73 3a 20 3c 34 65 | 35 65 65 39 24 6d 32 38 |ces: <4e|5ee9$m28|
|00000110| 5f 30 30 31 40 70 72 2e | 6d 63 73 2e 6e 65 74 3e |_001@pr.|mcs.net>|
|00000120| 20 3c 34 65 6d 6f 72 76 | 24 37 38 32 40 64 61 6d | <4emorv|$782@dam|
|00000130| 61 67 65 2e 75 73 61 31 | 2e 6e 65 74 3e 0a 4e 4e |age.usa1|.net>.NN|
|00000140| 54 50 2d 50 6f 73 74 69 | 6e 67 2d 48 6f 73 74 3a |TP-Posti|ng-Host:|
|00000150| 20 73 70 65 65 64 2e 73 | 61 73 6b 2e 61 65 63 6c | speed.s|ask.aecl|
|00000160| 2e 63 61 0a 4d 69 6d 65 | 2d 56 65 72 73 69 6f 6e |.ca.Mime|-Version|
|00000170| 3a 20 31 2e 30 0a 43 6f | 6e 74 65 6e 74 2d 54 79 |: 1.0.Co|ntent-Ty|
|00000180| 70 65 3a 20 74 65 78 74 | 2f 70 6c 61 69 6e 3b 20 |pe: text|/plain; |
|00000190| 63 68 61 72 73 65 74 3d | 75 73 2d 61 73 63 69 69 |charset=|us-ascii|
|000001a0| 0a 43 6f 6e 74 65 6e 74 | 2d 54 72 61 6e 73 66 65 |.Content|-Transfe|
|000001b0| 72 2d 45 6e 63 6f 64 69 | 6e 67 3a 20 37 62 69 74 |r-Encodi|ng: 7bit|
|000001c0| 0a 58 2d 4d 61 69 6c 65 | 72 3a 20 4d 6f 7a 69 6c |.X-Maile|r: Mozil|
|000001d0| 6c 61 20 32 2e 30 62 35 | 20 28 57 69 6e 4e 54 3b |la 2.0b5| (WinNT;|
|000001e0| 20 49 29 0a 54 6f 3a 20 | 22 63 72 62 33 40 75 73 | I).To: |"crb3@us|
|000001f0| 61 31 2e 63 6f 6d 22 20 | 3c 63 72 62 33 40 75 73 |a1.com" |<crb3@us|
|00000200| 61 31 2e 63 6f 6d 3e 0a | 0a 63 72 62 33 40 75 73 |a1.com>.|.crb3@us|
|00000210| 61 31 2e 63 6f 6d 20 77 | 72 6f 74 65 3a 0a 0a 3e |a1.com w|rote:..>|
|00000220| 20 69 6e 74 20 62 69 6f | 73 70 72 69 6e 74 28 69 | int bio|sprint(i|
|00000230| 6e 74 20 63 6d 64 2c 20 | 69 6e 74 20 61 62 79 74 |nt cmd, |int abyt|
|00000240| 65 2c 69 6e 74 20 70 6f | 72 74 29 3b 0a 3e 20 70 |e,int po|rt);.> p|
|00000250| 72 69 6e 74 65 72 20 49 | 2f 4f 20 75 73 69 6e 67 |rinter I|/O using|
|00000260| 20 42 49 4f 53 20 73 65 | 72 76 69 63 65 73 20 64 | BIOS se|rvices d|
|00000270| 69 72 65 63 74 6c 79 0a | 3e 20 70 72 6f 74 6f 74 |irectly.|> protot|
|00000280| 79 70 65 3a 20 62 69 6f | 73 2e 68 0a 3e 20 70 6f |ype: bio|s.h.> po|
|00000290| 72 74 3a 0a 3e 20 30 3d | 20 6c 70 74 31 20 2e 2e |rt:.> 0=| lpt1 ..|
|000002a0| 20 32 3d 20 6c 70 74 33 | 0a 3e 20 61 62 79 74 65 | 2= lpt3|.> abyte|
|000002b0| 3a 20 30 2e 2e 32 35 35 | 0a 3e 20 63 6d 64 3a 0a |: 0..255|.> cmd:.|
|000002c0| 3e 20 30 20 2d 20 70 72 | 69 6e 74 20 61 62 79 74 |> 0 - pr|int abyt|
|000002d0| 65 0a 3e 20 31 20 2d 20 | 69 6e 69 74 20 70 72 69 |e.> 1 - |init pri|
|000002e0| 6e 74 65 72 20 70 6f 72 | 74 0a 3e 20 32 20 2d 20 |nter por|t.> 2 - |
|000002f0| 72 65 61 64 20 70 72 69 | 6e 74 65 72 20 73 74 61 |read pri|nter sta|
|00000300| 74 75 73 0a 3e 20 20 20 | 74 68 61 74 27 73 20 74 |tus.> |that's t|
|00000310| 68 65 20 6d 6f 73 74 20 | 64 69 72 65 63 74 20 77 |he most |direct w|
|00000320| 61 79 20 74 6f 20 77 72 | 69 74 65 20 74 6f 20 61 |ay to wr|ite to a|
|00000330| 20 2a 73 70 65 63 69 66 | 69 63 2a 20 70 72 69 6e | *specif|ic* prin|
|00000340| 74 65 72 20 69 6e 20 61 | 0a 3e 20 42 6f 72 6c 61 |ter in a|.> Borla|
|00000350| 6e 64 20 43 20 70 72 6f | 67 72 61 6d 2e 20 50 75 |nd C pro|gram. Pu|
|00000360| 74 20 74 68 65 20 70 6f | 72 74 61 62 6c 65 20 6d |t the po|rtable m|
|00000370| 65 74 68 6f 64 20 69 6e | 20 74 68 65 20 70 72 6f |ethod in| the pro|
|00000380| 67 72 61 6d 20 74 6f 6f | 2c 20 74 68 6f 75 67 68 |gram too|, though|
|00000390| 3b 0a 3e 20 65 6c 73 65 | 20 68 6f 77 20 63 61 6e |;.> else| how can|
|000003a0| 20 79 6f 75 20 61 6c 6c | 6f 77 20 74 68 65 20 75 | you all|ow the u|
|000003b0| 73 65 72 20 74 6f 20 70 | 72 69 6e 74 2d 74 6f 2d |ser to p|rint-to-|
|000003c0| 64 69 73 6b 3f 0a 3e 20 | 2d 2d 63 72 0a 0a 0a 54 |disk?.> |--cr...T|
|000003d0| 68 61 74 20 77 6f 75 6c | 64 20 62 65 20 74 68 65 |hat woul|d be the|
|000003e0| 20 68 61 72 64 20 77 61 | 79 20 6f 66 20 64 6f 69 | hard wa|y of doi|
|000003f0| 6e 67 20 69 74 2e 20 20 | 49 20 73 75 67 67 65 73 |ng it. |I sugges|
|00000400| 74 20 6f 70 65 6e 69 6e | 67 20 61 20 73 74 72 65 |t openin|g a stre|
|00000410| 61 6d 20 74 6f 20 6c 70 | 74 31 20 0a 65 67 3a 0a |am to lp|t1 .eg:.|
|00000420| 0a 46 49 4c 45 20 2a 50 | 72 69 6e 74 65 72 3b 0a |.FILE *P|rinter;.|
|00000430| 70 72 69 6e 74 65 72 3d | 66 6f 70 65 6e 28 22 4c |printer=|fopen("L|
|00000440| 50 54 31 22 2c 22 77 62 | 22 29 3b 0a 0a 49 27 76 |PT1","wb|");..I'v|
|00000450| 65 20 75 73 65 64 20 74 | 68 69 73 20 69 6e 20 61 |e used t|his in a|
|00000460| 20 70 72 6f 67 72 61 6d | 20 49 20 77 72 6f 74 65 | program| I wrote|
|00000470| 2c 20 61 6e 64 20 69 74 | 27 73 20 70 72 65 74 74 |, and it|'s prett|
|00000480| 79 20 73 74 72 61 69 67 | 68 74 20 66 6f 72 77 61 |y straig|ht forwa|
|00000490| 72 64 2e 20 20 59 6f 75 | 20 63 61 6e 20 61 6c 73 |rd. You| can als|
|000004a0| 6f 20 73 65 6e 64 20 63 | 6f 6e 74 72 6f 6c 20 63 |o send c|ontrol c|
|000004b0| 68 61 72 61 63 74 65 72 | 73 20 74 6f 20 0a 63 68 |haracter|s to .ch|
|000004c0| 61 6e 67 65 20 66 6f 6e | 74 73 20 61 6e 64 20 73 |ange fon|ts and s|
|000004d0| 74 79 6c 65 73 2e 20 20 | 0a 0a 49 66 20 79 6f 75 |tyles. |..If you|
|000004e0| 20 6e 65 65 64 20 61 20 | 73 74 61 74 75 73 20 62 | need a |status b|
|000004f0| 61 63 6b 2c 20 79 6f 75 | 20 63 61 6e 20 65 69 74 |ack, you| can eit|
|00000500| 68 65 72 20 75 73 65 20 | 74 68 65 20 42 49 4f 53 |her use |the BIOS|
|00000510| 20 72 6f 75 74 69 6e 65 | 73 2c 20 6f 72 20 64 69 | routine|s, or di|
|00000520| 72 65 63 74 6c 79 20 72 | 65 61 64 20 74 68 65 20 |rectly r|ead the |
|00000530| 70 6f 72 74 20 65 67 3a | 0a 0a 73 74 61 74 75 73 |port eg:|..status|
|00000540| 3d 69 6e 70 6f 72 74 62 | 28 30 78 32 37 38 2b 31 |=inportb|(0x278+1|
|00000550| 29 0a 09 61 6e 64 0a 73 | 74 61 74 75 73 32 3d 69 |)..and.s|tatus2=i|
|00000560| 6e 70 6f 72 74 62 28 30 | 78 32 37 38 2b 32 29 0a |nportb(0|x278+2).|
|00000570| 0a 74 68 65 20 30 78 32 | 37 38 20 77 6f 75 6c 64 |.the 0x2|78 would|
|00000580| 20 62 65 20 74 68 65 20 | 62 61 73 65 20 61 64 64 | be the |base add|
|00000590| 72 65 73 73 20 6f 66 20 | 74 68 65 20 70 72 69 6e |ress of |the prin|
|000005a0| 74 65 72 2e 0a | |ter.. | |
+--------+-------------------------+-------------------------+--------+--------+